package Model;

import java.util.Calendar;
import java.util.Date;

import FileParser.FileParser;

public class User {
	
	private String name;
	private Conference conference;
	private String email;
	private String phone;
	private Date date;
	private FileParser file_Parser;

	

	public User() {
		
	}
	
	public User(FileParser a_fp) {
		file_Parser = a_fp;
	}
	
	public User(FileParser a_fp, String a_name) {
		name = a_name;
		file_Parser = a_fp;
	}
	
	public User(FileParser a_fp, String a_name, Conference a_conference) {
		name = a_name;
		conference = a_conference;
		file_Parser = a_fp;
	}

	public User(FileParser a_fp, String a_name, String a_email, String a_phone) {

		name = a_name;
		email = a_email;
		phone = a_phone;
		file_Parser = a_fp;
	}
	public User(String a_name, Conference a_conference, String a_email, String a_phone) {
		name = a_name;
		conference = a_conference;
		email = a_email;
		phone = a_phone;	
		date = getDate();
	}
	
	public Date getDate() {
		Date date = Calendar.getInstance().getTime();
		return date;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Conference getConference() {
		return conference;
	}
	public void setConference(Conference conference) {
		this.conference = conference;
	}
	
	public Object[] getListOfConferences() {
		return file_Parser.getListOfConferences().toArray();
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	 public void register(final String a_name, final String a_email, final String a_phone){
		 file_Parser.signUp(a_name, a_email, a_phone);
		 
	 }
	 public boolean login(final String name, final String role, final String conference){
		 return file_Parser.authenticateUser(role, name, conference);
		
	 }
	 
	 public boolean login(final String a_role, final String a_name){
		 return file_Parser.authenticateUser(a_role, a_name);
		
	 }
	 
	 public void signOut(){
		 
	 }
	 public void update(){
		 
	 }
	 
	 
	
}
